# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-autopep8
pkgver=2.0.4
pkgrel=0
pkgdesc="automatically format your Python code to conform to the PEP 8 style guide"
url="https://pypi.org/project/autopep8/"
arch="noarch"
license="MIT"
depends="
	py3-pycodestyle
	py3-tomli
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hhatto/autopep8/archive/refs/tags/v$pkgver.tar.gz"
#options="!check" # fail with py3.11
builddir="$srcdir/autopep8-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fe24fc402243c2fb250cc64725b4e9aac5fef85bacd90254333eda7bf18b452f001bef276c49f5c5ac4fcf0ff3495d0080484e2417ae46f8aef9f71706540a5b  py3-autopep8-2.0.4.tar.gz
"
